<%@ include file="/common/taglibs.jsp"%>
    <div class="navbar-custom-menu">
        <ul class="nav navbar-nav">
            <c:if test="${pageContext.request.remoteUser != null}">
            <!-- Messages: style can be found in dropdown.less-->
            <li class="dropdown messages-menu">
                <!-- Menu toggle button -->
                <a href="#" class="dropdown-toggle" data-toggle="dropdown">
                    <i class="fa fa-envelope-o"></i>
                    <span class="label label-success">${feedbacks.size()}</span>
                </a>
                <ul class="dropdown-menu">
                    <li class="header"> <fmt:message key="notify.message"><fmt:param value="${feedbacks.size()}"/></fmt:message></li>
                    <li>
                        <!-- inner menu: contains the messages -->
                        <ul class="menu">
                            <c:forEach var="loanRequest" items="${feedbacks}">
                            <li><!-- start message -->
                                <a  href="/loanRequestform?reqId=${loanRequest.id}">
                                    <!-- Message title and timestamp -->
                                    <h4>
                                        <c:out value="${loanRequest.number}"></c:out>
                                        <small style="font-weight: bold;"><i class="fa fa-eye" title='<fmt:message key="button.view"/>'></i></small>
                                    </h4>
                                    <!-- The message -->
                                    <p><fmt:message key="FEEDBACK_TYPE_${loanRequest.feedbackType}"/></p>
                                    <p><c:out value="${loanRequest.content}"></c:out></p>
                                </a>
                            </li><!-- end message -->
                            </c:forEach>
                        </ul><!-- /.menu -->
                    </li>
                </ul>
            </li><!-- /.messages-menu -->

            <!-- User Account Menu -->

            <li class="dropdown user user-menu">
                <!-- Menu Toggle Button -->
                <a href="#" class="dropdown-toggle" data-toggle="dropdown">
                    <!-- The user image in the navbar-->
                    <!-- hidden-xs hides the username on small devices so only the image appears. -->
                    <span class="">
                        ${pageContext.request.remoteUser}
                    </span>
                </a>
                <ul class="dropdown-menu">
                    <!-- The user image in the menu -->
                    <li class="user-header">
                        <p>
                            ${pageContext.request.remoteUser}
                        </p>
                    </li>
                    <!-- Menu Footer-->
                    <li class="user-footer">
                        <div class="pull-left">
                            <a class="btn btn-default btn-flat" href="<c:url value='/userform'/>"><fmt:message key="menu.user"/></a>
                        </div>
                        <div class="pull-right">
                            <a class="btn btn-default btn-flat" href="<c:url value="/updatePassword" />"><fmt:message key='updatePassword.changePasswordLink'/></a>
                        </div>
                    </li>
                </ul>
            </li>

            <!-- Control Sidebar Toggle Button -->
            <li>
                   <a href="<c:url value='/logout'/>">
                       <fmt:message key='user.logout'/></a>
            </li>
            </c:if>
        </ul>
    </div>
